package fr.pioug.gdocs.service;

import java.util.*;

/**
 * @author a011228
 * @version
 */
public class ResourceService {
	private static ResourceService mResourceService = null;

	private ResourceBundle mResourceBundle;

	private ResourceService() {
		mResourceBundle = ResourceBundle.getBundle("lang", Locale.getDefault());

	}

	/**
	 * @param pKey
	 * @return
	 */
	public String getValue(String pKey) {
		String lValue = null;
		try {
			lValue = mResourceBundle.getString(pKey);
		} catch (MissingResourceException lException) {
			lValue = pKey;
		}
		return lValue;
	}

	/**
	 * @return
	 */
	public static ResourceService getInstance() {
		if (mResourceService == null) {
			mResourceService = new ResourceService();
		}
		return mResourceService;
	}

}
